fixed broken sidebar
[lhc/web/wiklou.git] / skins / disabled / HTMLDump.php
1 <?php
2
3 /**
4 * Default skin for HTML dumps, based on MonoBook.php
5 */
6
7 if( !defined( 'MEDIAWIKI' ) )
8 die();
9
10 /** */
11 require_once( 'includes/SkinTemplate.php' );
12
13 /**
14 * Inherit main code from SkinTemplate, set the CSS and template filter.
15 * @todo document
16 * @package MediaWiki
17 * @subpackage Skins
18 */
19 class SkinHTMLDump extends SkinTemplate {
20 /** Using monobook. */
21 function initPage( &$out ) {
22 SkinTemplate::initPage( $out );
23 $this->template = 'HTMLDumpTemplate';
24 }
25
26 function buildSidebar() {
27 $sections = parent::buildSidebar();
28 foreach ( $sections as $heading => $section ) {
29 foreach ( $section as $index => $link ) {
30 if ( $link['href'] == $this->makeInternalOrExternalUrl( 'recentchanges-url' ) ) {
31 unset( $sections[$heading][$index] );
32 }
33 if ( $link['href'] == $this->makeInternalOrExternalUrl( 'randompage-url' ) ) {
34 unset( $sections[$heading][$index] );
35 }
36 }
37 }
38 return $sections;
39 }
40
41 function buildContentActionUrls() {
42 $content_actions = array();
43 $nskey = $this->getNameSpaceKey();
44 $content_actions[$nskey] = $this->tabAction(
45 $this->mTitle->getSubjectPage(),
46 $nskey,
47 !$this->mTitle->isTalkPage() );
48
49 $content_actions['talk'] = $this->tabAction(
50 $this->mTitle->getTalkPage(),
51 'talk',
52 $this->mTitle->isTalkPage(),
53 '',
54 true);
55 return $content_actions;
56 }
57
58 function makeBrokenLinkObj( &$nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
59 if ( !isset( $nt ) ) {
60 return "<!-- ERROR -->{$prefix}{$text}{$trail}";
61 }
62
63 if ( $nt->getNamespace() == NS_CATEGORY ) {
64 return $this->makeKnownLinkObj( $nt, $text, $query, $trail, $prefix );
65 }
66
67 if ( $text == '' ) {
68 $text = $nt->getPrefixedText();
69 }
70 return $prefix . $text . $trail;
71 }
72 }
73
74 /**
75 * @todo document
76 * @package MediaWiki
77 * @subpackage Skins
78 */
79 class HTMLDumpTemplate extends QuickTemplate {
80 /**
81 * Template filter callback for MonoBook skin.
82 * Takes an associative array of data set from a SkinTemplate-based
83 * class, and a wrapper for MediaWiki's localization database, and
84 * outputs a formatted page.
85 *
86 * @access private
87 */
88 function execute() {
89 $this->modifySetup();
90 $this->reallyExecute();
91 }
92
93
94 function modifySetup() {
95 /*
96 foreach ( $this->data['navigation_urls'] as $index => $link ) {
97 if ( $link['text'] == 'recentchanges' ) {
98 unset( $this->data['navigation_urls'][$index] );
99 } elseif ( $link['text'] */
100 }
101
102 function reallyExecute() {
103 wfSuppressWarnings();
104 ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
105 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php $this->text('lang') ?>" lang="<?php $this->text('lang') ?>" dir="<?php $this->text('dir') ?>">
106 <head>
107 <meta http-equiv="Content-Type" content="<?php $this->text('mimetype') ?>; charset=<?php $this->text('charset') ?>" />
108 <?php $this->html('headlinks') ?>
109 <title><?php $this->text('pagetitle') ?></title>
110 <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/main.css"; /*]]>*/</style>
111 <link rel="stylesheet" type="text/css" media="print" href="<?php $this->text('stylepath') ?>/common/commonPrint.css" />
112 <!--[if lt IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE50Fixes.css";</style><![endif]-->
113 <!--[if IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE55Fixes.css";</style><![endif]-->
114 <!--[if IE 6]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE60Fixes.css";</style><![endif]-->
115 <!--[if IE]><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath') ?>/common/IEFixes.js"></script>
116 <meta http-equiv="imagetoolbar" content="no" /><![endif]-->
117 <?php if($this->data['jsvarurl' ]) { ?><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('jsvarurl' ) ?>"></script><?php } ?>
118 <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath' ) ?>/common/wikibits.js"></script>
119 </head>
120 <body
121 <?php if($this->data['nsclass' ]) { ?>class="<?php $this->text('nsclass') ?>"<?php } ?>>
122 <div id="globalWrapper">
123 <div id="column-content">
124 <div id="content">
125 <a name="top" id="contentTop"></a>
126 <?php if($this->data['sitenotice']) { ?><div id="siteNotice"><?php $this->html('sitenotice') ?></div><?php } ?>
127 <h1 class="firstHeading"><?php $this->text('title') ?></h1>
128 <div id="bodyContent">
129 <h3 id="siteSub"><?php $this->msg('tagline') ?></h3>
130 <div id="contentSub"><?php $this->html('subtitle') ?></div>
131 <?php if($this->data['undelete']) { ?><div id="contentSub"><?php $this->html('undelete') ?></div><?php } ?>
132 <?php if($this->data['newtalk'] ) { ?><div class="usermessage"><?php $this->html('newtalk') ?></div><?php } ?>
133 <!-- start content -->
134 <?php $this->html('bodytext') ?>
135 <?php if($this->data['catlinks']) { ?><div id="catlinks"><?php $this->html('catlinks') ?></div><?php } ?>
136 <!-- end content -->
137 <div class="visualClear"></div>
138 </div>
139 </div>
140 </div>
141 <div id="column-one">
142 <div id="p-cactions" class="portlet">
143 <h5>Views</h5>
144 <ul>
145 <?php foreach($this->data['content_actions'] as $key => $action) {
146 ?><li id="ca-<?php echo htmlspecialchars($key) ?>"
147 <?php if($action['class']) { ?>class="<?php echo htmlspecialchars($action['class']) ?>"<?php } ?>
148 ><a href="<?php echo htmlspecialchars($action['href']) ?>"><?php
149 echo htmlspecialchars($action['text']) ?></a></li><?php
150 } ?>
151 </ul>
152 </div>
153 <div class="portlet" id="p-logo">
154 <a style="background-image: url(<?php $this->text('logopath') ?>);"
155 href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>"
156 title="<?php $this->msg('mainpage') ?>"></a>
157 </div>
158 <script type="<?php $this->text('jsmimetype') ?>"> if (window.isMSIE55) fixalpha(); </script>
159 <?php foreach ($this->data['sidebar'] as $bar => $cont) { ?>
160 <div class='portlet' id='p-<?php echo htmlspecialchars($bar) ?>'>
161 <h5><?php $this->msg( $bar ) ?></h5>
162 <div class='pBody'>
163 <ul>
164 <?php foreach($cont as $key => $val) { ?>
165 <li id="<?php echo htmlspecialchars($val['id']) ?>"><a href="<?php echo htmlspecialchars($val['href']) ?>"><?php echo htmlspecialchars($val['text'])?></a></li>
166 <?php } ?>
167 </ul>
168 </div>
169 </div>
170 <?php } ?>
171 <?php if( $this->data['language_urls'] ) { ?><div id="p-lang" class="portlet">
172 <h5><?php $this->msg('otherlanguages') ?></h5>
173 <div class="pBody">
174 <ul>
175 <?php foreach($this->data['language_urls'] as $langlink) { ?>
176 <li>
177 <a href="<?php echo htmlspecialchars($langlink['href'])
178 ?>"><?php echo $langlink['text'] ?></a>
179 </li>
180 <?php } ?>
181 </ul>
182 </div>
183 </div>
184 <?php } ?>
185 </div><!-- end of the left (by default at least) column -->
186 <div class="visualClear"></div>
187 <div id="footer">
188 <?php if($this->data['poweredbyico']) { ?><div id="f-poweredbyico"><?php $this->html('poweredbyico') ?></div><?php } ?>
189 <?php if($this->data['copyrightico']) { ?><div id="f-copyrightico"><?php $this->html('copyrightico') ?></div><?php } ?>
190 <ul id="f-list">
191 <?php if($this->data['lastmod' ]) { ?><li id="f-lastmod"><?php $this->html('lastmod') ?></li><?php } ?>
192 <?php if($this->data['numberofwatchingusers' ]) { ?><li id="f-numberofwatchingusers"><?php $this->html('numberofwatchingusers') ?></li><?php } ?>
193 <?php if($this->data['credits' ]) { ?><li id="f-credits"><?php $this->html('credits') ?></li><?php } ?>
194 <?php if($this->data['copyright' ]) { ?><li id="f-copyright"><?php $this->html('copyright') ?></li><?php } ?>
195 <?php if($this->data['about' ]) { ?><li id="f-about"><?php $this->html('about') ?></li><?php } ?>
196 <?php if($this->data['disclaimer']) { ?><li id="f-disclaimer"><?php $this->html('disclaimer') ?></li><?php } ?>
197 <?php if($this->data['tagline']) { ?><li id="f-tagline"><?php echo $this->data['tagline'] ?></li><?php } ?>
198 </ul>
199 </div>
200 </div>
201 <?php $this->html('reporttime') ?>
202 </body>
203 </html>
204 <?php
205 wfRestoreWarnings();
206 }
207 }
208 ?>